<template>
    <div>
        <el-card>

            <el-row style="padding-top: 15px;">
                <el-row>
                    <el-col :span="7">
                        <span>搜索：</span>
                        <el-input v-model="student" placeholder="请输入学生姓名搜索" style="width: 180px;" size="mini"
                            clearable></el-input>
                        <el-button type="primary" el-icon-plus size="mini" @click="getCurrentPageData()">
                            查询</el-button>
                    </el-col>
                    <el-row style="margin-top: 2%;">
                        <el-table :data="tableData" stripe style="margin-top: 20px;" border>
                            <el-table-column prop="studentName" label="学员姓名">
                            </el-table-column>
                            <el-table-column prop="gender" label="性别">
                            </el-table-column>
                            <el-table-column prop="birthdate" label="出生日期">
                            </el-table-column>
                            <el-table-column prop="cellphone" label="联系电话">
                            </el-table-column>
                            <el-table-column prop="campus" label="咨询校区">
                            </el-table-column>
                            <el-table-column prop="source" label="招生来源">
                            </el-table-column>
                            <!-- <el-table-column prop="createTime" label="录入时间">
                            </el-table-column> -->
                            <el-table-column prop="teacher" label="录入人">
                            </el-table-column>
                            <el-table-column label="编辑" width="180">
                                <template slot-scope="scope">
                                    <el-link :underline="false" type="primary" style="font-size: 12px"
                                        @click="detail(scope.row.id)">详情</el-link>
                                </template>
                            </el-table-column>
                        </el-table>
                        <el-row>
                            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                                :current-page="currentPage" :page-sizes="[7]" :page-size="size"
                                layout="sizes, prev, pager, next, jumper,total" :total="total">
                            </el-pagination>
                        </el-row>
                    </el-row>
                </el-row>
            </el-row>
            <el-dialog title="删除详情" :visible.sync="dialogTableVisible">
                <el-row style="margin-top: 2%;">
                    <span style="font-size: larger; margin-right: 15%;">跟踪状态： {{ state }}</span>
                   
                </el-row>
                <el-row style="margin-top: 2%;">
                    <span style="font-size: larger; margin-right: 19%;">意向程度： {{ leveling }}</span>
                   
                </el-row>
                <el-row style="margin-top: 2%;">
                    <span style="font-size: larger; margin-right: 22%;">父母：{{ parentsName }}</span>
                
                </el-row>
                <el-row style="margin-top: 2%;">
                    <el-col>
                        <span style="font-size: larger; ">创建时间：{{ createTime }}</span>
                    
                    </el-col>
                    
                </el-row>
                <el-row style="margin-top: 2%;">
                    <span style="font-size: larger; ">删除时间：{{ delTime }}</span>
                
                </el-row>
            </el-dialog>
        </el-card>

    </div>
</template>

<script>
export default {
    name: "eCharts",
    data() {
        return {

            student: '',
            tableData: [],
            currentPage: 1,     // 当前页页码
            size: 10,            // 当前页大小
            total: 0,
            gridData: {},
            dialogTableVisible: false,
            sourceId:'',
            state:'',
            leveling:'',
            parentsName:'',
            createTime:'',
            delTime:''


        };
    },
    methods: {
        //分页
        handleSizeChange(val) { // 页面大小修改时触发
            console.log(`1每页 ${val} 条`);
        },
        handleCurrentChange(val) { // 页码修改时触发
            console.log(`1当前页: ${val}`);
            // 给当前页属性赋值
            this.currentPage = val
            // 发请求获取数据
            this.getCurrentPageData()
        },
        choiceSchool: function () {
            console.log(this.school)
        },
        choiceSource: function () {
            console.log(this.studentSource)
        },

        getCurrentPageData: function () {
            // 页面加载时需要将当前页、页大小作为参数传给后台  key=value 传值
            //  /money/tenement?page=1&size=10
            let data = {
                studentName: this.student,
                page: this.currentPage,
                size: this.size
            }
            this.$axios.post("/prospectiveStudent/findByDelPage", data).then(res => {
                console.log(res.data)
                this.tableData = res.data.data.data
                // 总条数
                this.total = res.data.data.total
            })
        },
        detail: function (id) {
            this.dialogTableVisible=true;
            this.$axios.post("/prospectiveStudent/findDelDetailById/"+id).then(res => {
                console.log(res.data)
              //  this.gridData = res.data.data
              this.state = res.data.data.state
              this.leveling = res.data.data.leveling
              this.parentsName = res.data.data.parentsName
              this.createTime = res.data.data.createTime
              this.delTime = res.data.data.delTime
            })
        }

    },
    mounted() {
        this.getCurrentPageData()
    },
};
</script>



<style scoped></style>


<style scoped></style>